<!DOCTYPE html>
<html>
	<head>
		<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
		<meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport" />
		<meta content="telephone=no" name="format-detection" />
		<meta content="address=no" name="format-detection" />
		<meta name="apple-mobile-web-app-capable" content="no" />
		<link rel="apple-touch-icon-precomposed" href="http://img0.zz91.com/zz91/images/logo.png" />
		<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-precomposed" />
		<meta name="apple-touch-fullscreen" content="YES">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="shortcut icon" href="http://img0.zz91.com/front/favicon.ico" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="http://b.zz91.com/layui/css/layui.css"/>	
		<script type="text/javascript" src="http://b.zz91.com/layui/layui.js"></script>
		<!--[if lt IE 9]>
		  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
		  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
		<style>
			.mainbox{
				margin: 10px;
			}
			.grid-demo{
				padding: 20px; 
				text-align: center;
				background-color: #79C48C; 
				color: #fff;
				margin: 20px 0 10px;
			}
			.grid-demo span{
				font-size: 18px;
				font-weight: bold;
			}
		</style>
	</head>
	<body>
		<div class="mainbox">
			<div class="demoTable">
				<div class=" layui-form">
				  	
				    <div class="layui-inline layui-form-item" style="margin-bottom: 0;">
				    	<label class="layui-form-label" style="width: 30px;">时间</label>
				      	<div class="layui-input-inline" style="width: 100px;">
				        	<input type="text" name="time_min" placeholder="" autocomplete="off" class="layui-input">
				     	</div>
				      	<div class="layui-form-mid">至</div>
				      	<div class="layui-input-inline" style="width: 100px;">
				        	<input type="text" name="time_max" placeholder="" autocomplete="off" class="layui-input">
				      	</div>
				    </div>
				  	
			  		<button class="layui-btn layui-btn-normal" data-type="reload">搜索</button>
				</div>
			</div>
			 
			<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table> 
			
			<!--<div class="demoTable" style="margin-top: 50px;">
				<div class=" layui-form">
				  	
				    <div class="layui-inline layui-form-item" style="margin-bottom: 0;">
				    	<label class="layui-form-label" style="width: 30px;">时间</label>
				      	<div class="layui-input-inline" style="width: 100px;">
				        	<input type="text" name="time_min" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
				     	</div>
				      	<div class="layui-form-mid">至</div>
				      	<div class="layui-input-inline" style="width: 100px;">
				        	<input type="text" name="time_max" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
				      	</div>
				    </div>
				  	
			  		<button class="layui-btn layui-btn-normal" data-type="reload">搜索</button>
				</div>
			</div>
			 
			<table class="layui-hide" id="LAY_table_user2" lay-filter="user"></table> -->
		</div>
	</body>
	<script src="js/jquery.js" charset="utf-8"></script>
	<script src="js/comm.js" charset="utf-8"></script>
	<script>
		layui.use(['table','laydate'], function(){
		  var table = layui.table;
		  var laydate = layui.laydate;
		  //日期
			laydate.render({
				elem: '.layui-input'
			});
		  //方法级渲染
		  table.render({
		    elem: '#LAY_table_user'
		    ,url: 'finance_productstotal_data.html'
		    ,cols: [[
		      //{checkbox: true, fixed: true}
		      {field:'datevalue', title: '时间', width:120, fixed: true}
		      {%for list in prolist%}
		      ,{field:'_{{list.selfid}}', title: '{{list.name}}', width:100}
		      {%endfor%}
		      ,{field:'weightall', title: '总量', width:100}
		      ,{field:'priceall', title: '总金额', width:120}
		    ]]
		    ,id: 'testReload'
		    ,page: true
		    ,limit:10
		    ,limits:[]
		    ,height: 400
		  });
		  
		  var $ = layui.$, active = {
		    reload: function(){
		      var demoReload = $('#demoReload');
		      
		      table.reload('testReload', {
		        where: {
		          key: {
		            id: demoReload.val()
		          }
		        }
		      });
		    }
		  };
		  
		  $('.demoTable .layui-btn').on('click', function(){
		    var type = $(this).data('type');
		    active[type] ? active[type].call(this) : '';
		  });
		});
		
		layui.use('table', function(){
		  var table = layui.table;
		  
		  //方法级渲染
		  table.render({
		    elem: '#LAY_table_user2'
		    ,url: 'finance_inall.html'
		    ,cols: [[
		      {checkbox: true, fixed: true}
		      ,{field:'name', title: '品名', width:120, fixed: true}
		      ,{field:'total_gw', title: '入库量（kg）', width:120}
		      ,{field:'total_price', title: '入库总额(元)', width:120}
		      ,{field:'average', title: '均价', width:100}
		    ]]
		    ,id: 'testReload'
		    ,page: true
		    ,height: 315
		  });
		  
		  var $ = layui.$, active = {
		    reload: function(){
		      var demoReload = $('#demoReload');
		      
		      table.reload('testReload', {
		        where: {
		          key: {
		            id: demoReload.val()
		          }
		        }
		      });
		    }
		  };
		  
		  $('.demoTable .layui-btn').on('click', function(){
		    var type = $(this).data('type');
		    active[type] ? active[type].call(this) : '';
		  });
		});
	</script>
</html>
